<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>{%$web_name%}</title>
<link href="{%$URL%}css/base.css" rel="stylesheet" type="text/css">
<script src="{%$URL%}js/jquery-1.9.0.min.js"></script>
<script src="{%$URL%}js/jquery.touchslider.js"></script>
<script src="{%$URL%}js/js.js"></script>
<script type="text/javascript">
$(function(){
		$("#gengduo_button").click(function(){
			var num=4;//显示个数
			var page=$("#gengduo_button").attr('page');//第几个分页
			var nodata=$("#gengduo_button").attr('nodata');//判断是否有数据
			if(page){
				page=parseInt(page);
				}else{
					page=1;
					}
			var type='{%$smarty.get.c_id%}';//新闻所属分类
			var lanmu='{%$smarty.get.lanmu%}';//新闻所属栏目
			//$("#test").text("栏目:"+lanmu+"数量:"+num+"类型:"+type+"分页:"+page);
			if(lanmu){
				if(nodata!=="no"){
					$.post("action/products_list_ajax.php",{products_num:num,products_page:page,products_type:type,products_lanmu:lanmu},function(data){
						if(data){
							if(data=="2"){
								alert("服务器错误，请稍后重试！");
								}else{
									if(data=="1"){
										alert("没有更多数据了！");
										$("#gengduo_button").attr('nodata','no');
										}else{
											$(".Products_list").append(data);
											page=page+1;
											$("#gengduo_button").attr('page',page);
											}
									}
							}else{
								alert("网络错误，请稍候重试！")
								}
						})
						}else{
							alert("没有更多数据了！");
							}
				}else{
					alert("请求参数不正确！");
					}
			})
		})

function dianjishow(i){
	$(".show").hide();
	$("#hhshow"+i).show();
	}
</script>
</head>

<body>
{%include file="head.htm"%}
<div id="ceng" style="display: none; width: 100%; height: 100%; z-index: 100; position: absolute; top: 0; right: 0; bottom: 0;">
  <div id="close" style="width: 55%; background: #444; height: 100%; float: left; background-color: rgba(0, 0, 0, 0.5)"><img src="{%$URL%}img/close.png" style="padding: 15px"></div>
  <div style="width: 45%; background: #b80b0c; height: 100%; float: left" class="type">
    <ul>
      {%lcmx_v_products_type set="列表名:productstype,所属栏目:GET[lanmu],所属类别:0"%}
      {%foreach from=$productstype item=list%}
      <li><a onClick="dianjishow({%$list.i%})">+&nbsp;{%$list.c_title%}</a>
        <ul class="show" id="hhshow{%$list.i%}" style="display: none">
          {%lcmx_v_products_type set="列表名:productstype2,所属栏目:GET[lanmu],所属类别:{%$list.c_id%}"%}
          {%foreach from=$productstype2 item=list2%}
          <li><a href="index.php?p=products_list&c_id={%$list2.c_id%}&lanmu={%$list2.lanmu%}">&nbsp;&nbsp;&nbsp;{%$list2.c_title%}</a></li>
          {%/foreach%}
        </ul>
      </li>
      {%/foreach%}
    </ul>
  </div>
</div>
<article>
  <div class="sub_title"><a href=""><span class="title">首页 > {%$LCMX.lanmu_name%}</span></a></div>
  <section class="products_list"> {%lcmx_v_products_list set="列表名:products,显示数目:4,标题长度:20,类别:GET[c_id],栏目:GET[lanmu],分页显示:1"%}
    {%if $products %}
    {%foreach from=$products item=list%}
    <article>
      <div class="img"><a href="index.php?p=products_show&id={%$list.id%}"><img src="{%$list.pic%}"></a></div>
      <p class="h9">{%$list.title%}</p>
      <div class="yijiancon">
        <div class="yijian6"><a href="index.php?p=products_show&id={%$list.id%}">查看详情</a></div>
      </div>
    </article>
    {%/foreach%}
    {%/if%} </section>
  <div class="sub_more">
    <div>
      <input name="更多" type="button" id="gengduo_button" page="2" value="显示更多">
    </div>
  </div>
</article>

<!--一键沟通--> 
{%include file="yijian.htm"%} 
<!--一键沟通结束--> 

{%include file="foot.htm"%}
</body>
</html>
